package cn.ad.server.persistence.dao;

import cn.ad.server.domain.ad.InteractionRedirects;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface InteractionRedirectsDao {

	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "target_url", property = "targetUrl") })
	@Select("select * from interaction_redirects")
	public List<InteractionRedirects> findAll();
	
//	@Results(value = { 
//			@Result(column = "id", property = "id", id=true),
//			@Result(column = "target_url", property = "targetUrl") })
//	@Select("select * from interaction_redirects where update_time >= #{value}")
//	public List<InteractionRedirects> findAfterTime(String warmUpTime);

	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "target_url", property = "targetUrl") })
	@Select("select * from interaction_redirects where id = #{value}")
	public InteractionRedirects findById(long id);

}
